<%@page contentType="text/html; charset=UTF-8" language="java" %>
<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-html"  prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean"  prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<%@page import="com.kcs.common.utils.commonUtils"%>
<%@page import="com.kcs.common.utils.PropsUtils"%>
<%@page import="com.kcs.common.utils.Constant"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
<title>Pre-Settlement Risk Detail</title>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script type="text/javascript" src="jsp/script/jquery/plugin/fancybox/jquery.easing-1.3.pack.js"></script>
<script type="text/javascript" src="jsp/script/jquery/plugin/fancybox/jquery.fancybox-1.3.4.js"></script>
<script type="text/javascript" src="jsp/script/jquery/plugin/fancybox/jquery.fancybox-1.3.4.pack.js"></script>    
<script type="text/javascript" src="jsp/script/common.js"></script>  
<link rel="stylesheet" type="text/css" href="jsp/script/jquery/plugin/fancybox/jquery.fancybox-1.3.4.css"/>
<link rel="stylesheet" type="text/css" href="jsp/css/table.css"/>
<link rel="stylesheet" type="text/css" href="jsp/css/fxmarginStyle.css"/>
<script type="text/javascript">

	$(document).ready(function() {
		jQuery("#action").val("init");
	});
	
	function exportPDFFunction(){
		jQuery("#action").val("exportToPDF");
		submitform();
	}

	function exportExcelFunction(){
		jQuery("#action").val("exportToExcel");
		submitform();
	}
	
	function search(){
		loading();
		jQuery("#action").val("search");
		submitform();
	}

	function resetFunction(){
		loading();
		jQuery("#action").val("init");
		submitform();
	}
	
</script>
</head>
<body><%@ include	file="include/headerMenu.jsp"%>

<center>
<div style="width:95%" align="center">

	<html:form action="/PreSettlementAction.do">
		<html:hidden property="action" styleId="action"/>
		
		<table width="100%" class="MarginHeader">
			<tr>
				<td align="left">Pre-Settlement Risk Detail </td>
			</tr>
		</table>
		
		<div class="CriteriaBox">
			
			<table width="100%" class="MarginCriteria">
				<tr>
					<td width="100%" align="center">
						<input type="button" value="Search" class="button" onclick="search();"/>&nbsp;&nbsp;
						<!--  <input type="button" value="Reset" class="button" onclick="resetFunction();"/>&nbsp;&nbsp;  -->
						
						<logic:empty name="PreSettlementActionForm" property="preSettleBoList">
							<input type="button" value="Export PDF" class="button" disabled="disabled"/>&nbsp;&nbsp;
							<input type="button" value="Export Excel" class="button" disabled="disabled"/>
						</logic:empty>
						
						<logic:notEmpty name="PreSettlementActionForm" property="preSettleBoList">
							<input type="button" value="Export PDF" class="button" onclick="exportPDFFunction();"/>&nbsp;&nbsp;
							<input type="button" value="Export Excel" class="button" onclick="exportExcelFunction();"/>
						</logic:notEmpty>
						
					</td>
				</tr>
			</table>
		</div>
	
		<logic:present name="<%=Constant.SHOW_RESULT%>">
			<div class="MarginTable" >
				<display:table id="data" name="sessionScope.PreSettlementActionForm.preSettleBoList" requestURI="/PreSettlementAction.do" pagesize="10"  >
					
					<display:column property="typeOfDeal"	sortable="false" title="Type of deal" class="center"/>
					<display:column property="dealId"   	sortable="false" title="Deal Id" class="center"/>
					<display:column property="counterParty" sortable="false" title="Counterparty" class="left"/>			
					<display:column property="instrument" 	sortable="false" title="Instrument" class="left"/>
					<display:column property="branceCode"   sortable="false" title="Branch Code" class="left"/>
					<display:column property="comments"   	sortable="false" title="Comments" class="left"/>
					<display:column property="matdate" 		sortable="false" title="Days to Mat" class="center" format="{0,date,dd/MM/yyyy}"/>			
					<display:column property="notional" 	sortable="false" title="Notional" class="right" format="{0,number,#,##0.00}" />
					<display:column property="curr"   		sortable="false" title="Cur." class="center"/>
					<display:column property="mktValue" 	sortable="false" title="MarketValue_THB" class="right" format="{0,number,#,##0.00}" />			
					<display:column property="addOn" 		sortable="false" title="Add On" class="right" format="{0,number,#,##0.00}" />
					<display:column property="deductMargin" sortable="false" title="Deduct Margin" class="right" format="{0,number,#,##0.00}" />
					<display:column property="preSettleRisk"sortable="false" title="Pre-settle Risk" class="right" format="{0,number,#,##0.00}" />			
				</display:table>
			</div>
		</logic:present>

		
		<%@ include	file="include/footer.jsp"%> 
		<%@ include	file="include/message.jsp"%> 
	</html:form>	
		
</div>
</center>


</body>
</html>